﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Units.aspx.vb" Inherits="ExpWeb.Units" %>

<%@ Register Src="~/User_Control/ucUnitView.ascx" TagPrefix="uc1" TagName="ucUnitView" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1 {
            color: #000000;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class="row">
        <div class="col-md-2">
            <h3>Unit</h3>
        </div>
        <div class="col-md-10">
        </div>
    </div>

    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
        <asp:View ID="View1" runat="server">

                <div class="row">
                    <div class="col-lg-8 col-lg-offset-2">
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label>Country :</label>
                                <asp:DropDownList ID="ddlCountrySearch" runat="server" CssClass="form-control"></asp:DropDownList>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label>Brand :</label>
                                <asp:DropDownList ID="ddlBrandSearch" runat="server" CssClass="form-control"></asp:DropDownList>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label>Resort :</label>
                                <asp:DropDownList ID="ddlResortSearch" runat="server" CssClass="form-control"></asp:DropDownList>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label>Location :</label>
                                <asp:TextBox ID="txtLocation" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>
                        </div>
                        <div class="col-lg-8 col-lg-offset-5">
                            <asp:LinkButton ID="btn_search" runat="server" OnClick="btnSearch_Click" CssClass="btn btn-default"><span class="glyphicon glyphicon-search"></span> Search</asp:LinkButton>
                        </div>
                            
                    </div>
                </div>
            <div class="col-lg-8 col-lg-offset-2">
                        <div class="col-lg-12 text-right">
                            <asp:LinkButton ID="btn_Add" runat="server" CommandArgument="View2" CommandName="SwitchViewByID" CssClass="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Add</asp:LinkButton>
                        </div>
            <asp:GridView ID="gv_data" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="Unit_ID" CssClass="table table-hever" GridLines="None">
                                    <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#6B696B"></HeaderStyle>
                        <Columns>
                            <asp:BoundField DataField="Unit_ID" ItemStyle-Width="50" Visible="false" />
                            <asp:TemplateField HeaderText="Edit" >
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="top" Width="50px" />
                                <HeaderTemplate>
                                    <center>Edit</center>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ToolTip="Edit" CommandName="edit" CommandArgument='<%#Eval("Unit_ID")%>' ID="LinkButton1">
                                    <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Delete">
                                <HeaderTemplate>
                                    <center>Delete</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="top" Width="50px" />
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ToolTip="Delete" CommandName="Delete" CommandArgument='<%#Eval("Unit_ID")%>' ID="LinkButton2" OnClientClick="return confirm('Make sure, Delete this one?');">
                                    <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Delete">
                                <HeaderTemplate>
                                    <center>detail</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="top" Width="50px" />
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ToolTip="Detail" CommandName="Detail" CommandArgument='<%#Eval("Unit_ID")%>' ID="LinkButton3">
                                    <span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>No</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="top" Width="30px" />
                                <ItemTemplate>
                                    <%# Container.DataItemIndex + 1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Resort Name</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="top" Width="150px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblResort_ID" runat="server" Text='<%# Eval("Resort_ID")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Unit Type</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="top" Width="150px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblUnitType_ID" runat="server" Text='<%# Eval("UnitType_ID")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Unit Number</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="top" Width="150px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblUnitName" runat="server" Text='<%# Eval("UnitName")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Brand</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="top" Width="150px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblBrand_ID" runat="server" Text='<%# Eval("Brand_ID")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Country</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="top" Width="150px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblCountry_ID" runat="server" Text='<%# Eval("Country_ID")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Status</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="top" Width="80px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblIsActive" runat="server" Text='<%# Eval("IsActive")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerTemplate>
                            <asp:Repeater ID="rptPager" runat="server" OnItemCommand="rptPager_ItemCommand">
                                <HeaderTemplate>
                                    <nav><ul class="pagination">
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <li>
                                        <asp:LinkButton ID="lnkPage" Text='<%# Container.DataItem %>' OnClick="lnkPage_Click" CommandName="ChangePage" CommandArgument="<%# Container.DataItem - 1%>" runat="server"   />
                                    </li>
                                </ItemTemplate>
                                 <FooterTemplate>
                                    </ul></nav>
                                </FooterTemplate>
                            </asp:Repeater>
                        </PagerTemplate>                        
                    </asp:GridView>

                </div>
        </asp:View>

        <asp:View ID="View2" runat="server">

            <div class="col-lg-6 col-lg-offset-3" style="margin-bottom: 50px;">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <asp:Label ID="lblPanelHeader" runat="server" Text="Add/Edit Unit"></asp:Label>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Unit Number :</label>
                                    <asp:TextBox ID="TxtUnitNumber" runat="server" CssClass="form-control" MaxLength="100"></asp:TextBox>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Unit Type :</label>
                                    <asp:DropDownList ID="ddl_UnitType" runat="server" CssClass="form-control" AutoPostBack="True">
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Brand :</label>
                                    <asp:DropDownList ID="ddl_Brand" runat="server" CssClass="form-control" AutoPostBack="True"></asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Resort :</label>
                                    <asp:DropDownList ID="ddl_Resort" runat="server" CssClass="form-control" AutoPostBack="True"></asp:DropDownList>
                                </div>
                            </div>

                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Currency :</label>
                                    <asp:DropDownList ID="ddlCurrency" runat="server" CssClass="form-control" AutoPostBack="True">
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Rate :</label>
                                    <asp:TextBox ID="txtRate" runat="server" CssClass="form-control"></asp:TextBox>
                                    <label>
                                        (per night)</label>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Area size :</label>
                                    <asp:TextBox ID="txtAreasize" runat="server" CssClass="form-control"></asp:TextBox>
                                    <label>
                                        (sqr.m.)</label>
                                </div>
                            </div>

                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Book night :</label>
                                    <asp:TextBox ID="txtBookNight" runat="server" CssClass="form-control"></asp:TextBox>
                                    <label>
                                        (per night)</label>
                                </div>
                            </div>
                            <div class="col-lg-12">
                                <div class="form-group">
                                    <label>Address :</label>
                                    <asp:TextBox ID="txtAddress" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div class="col-lg-12">
                                <div class="form-group">
                                    <label>Description :</label>
                                    <asp:TextBox ID="txtDescription" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div class="col-lg-6" style="float: Right;">
                                <div class="form-group">
                                    <label>Status :</label>
                                    <asp:DropDownList ID="ddl_Status" runat="server" CssClass="form-control" AutoPostBack="True">
                                        <asp:ListItem Value="1">Active</asp:ListItem>
                                        <asp:ListItem Value="0">InActive</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-lg-3">
                            </div>


                        </div>
                        <asp:HiddenField ID="HDFieldUnitID" runat="server" />
                    </div>

                </div>
                <div class="panel-footer">
                    <asp:Button ID="btn_Save" runat="server" Text="SAVE" CssClass="btn btn-default" />&nbsp;
                        <asp:Button ID="btn_Cancel" runat="server" CommandArgument="View1" CommandName="SwitchViewByID" Text="Back" CssClass="btn btn-default" />
                </div>
            </div>

        </asp:View>
        <asp:View ID="View3" runat="server">
            <div class="col-lg-12 col-lg-offset-9 text-middle">
                <asp:Button ID="btnBackView" runat="server" Text="Back" CssClass="btn btn-default" />
            </div>
            <div class="col-lg-8 col-lg-offset-2 text-middle">
                <uc1:ucUnitView runat="server" ID="ucUnitView" />
            </div>

        </asp:View>
    </asp:MultiView>


</asp:Content>


<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script type="text/javascript">
        ActiveMenuIndex(0);
    </script>
</asp:Content>
